<template>
    <div class="header">
      <div class="logo">
        <div class="font">
          <span>{{ logoName }}</span>
          <span>{{ logoNameE }}</span>
        </div>
      </div>
      <div class="title">{{ title }}</div>
      <div class="menu" v-if="menus!= null">
        <div class="button" v-for="(btn, index) in menus" :key="index" @click="pageSkip(btn)">{{ btn.name }}</div>
      </div>
    </div>
</template>
<script>
export default {
  name: "Header",
  props: {
    title: String,
    menus: Array,
  },
  data() {
    return {
      logoName: "南京南瑞继保电气有限公司",
      logoNameE: "联系电话：800-828-9967 400-828-9967",
    };
  },
  methods:{
    pageSkip(item){
      if(item.operateType === '页面跳转'){
        this.$router.push(item.data)
      }

    }
  },
  mounted() {
    // 设置滚动条
    this.$root.$el.style="overflow:auto"
  },
};
</script>
<style lang="less" scoped>
.header {
  display: flex;
  justify-content: center;
  color: #fff;
  padding: 20px 20px;
  border-bottom: 1px solid #fff;
  position: relative;

  .logo {
    position: absolute;
    left: 20px;
    display: flex;

    .font {
      font-size: 20px;
      margin-left: 20px;
      display: flex;
      flex-direction: column;
      font-family: "宋体";

      span {
        font-size: 18px;
        font-weight: bold;

        &:nth-child(1) {
          padding-bottom: 3px;
          border-bottom: 2px solid #fff;
        }
      }
    }
  }

  .title {
    font-size: 36px;
  }

  .menu {
    position: absolute;
    right: 10px;
    bottom: 3px;
    display: flex;

    .button {
      width: 100px;
      height: 30px;
      line-height: 30px;
      text-align: center;
      font-size: 16px;
      color: black;
      background-color: #cbcbcb;
      border: 1px solid #333;
      box-shadow: inset;
      border-radius: 6px;
      cursor: pointer;

      &:hover {
        background-color: #fff;
      }
    }
  }
}
</style>
